import request from '@/config/axios'

/** 文件分组信息 */
export interface FileClassify {
          id: number; // 编号
          name: string; // 分组名
  }

// 文件分组 API
export const FileClassifyApi = {
  // 查询文件分组分页
  getFileClassifyPage: async (params: any) => {
    return await request.get({ url: `/infra/file-classify/page`, params })
  },

  // 查询文件分组简单列表
  getFileClassifySimpleList: async () => {
    return await request.get({ url: `/infra/file-classify/simple-list` })
  },

  // 查询文件分组详情
  getFileClassify: async (id: number) => {
    return await request.get({ url: `/infra/file-classify/get?id=` + id })
  },

  // 新增文件分组
  createFileClassify: async (data: FileClassify) => {
    return await request.post({ url: `/infra/file-classify/create`, data })
  },

  // 修改文件分组
  updateFileClassify: async (data: FileClassify) => {
    return await request.put({ url: `/infra/file-classify/update`, data })
  },

  // 删除文件分组
  deleteFileClassify: async (id: number) => {
    return await request.delete({ url: `/infra/file-classify/delete?id=` + id })
  },

  /** 批量删除文件分组 */
  deleteFileClassifyList: async (ids: number[]) => {
    return await request.delete({ url: `/infra/file-classify/delete-list?ids=${ids.join(',')}` })
  },

  // 导出文件分组 Excel
  exportFileClassify: async (params) => {
    return await request.download({ url: `/infra/file-classify/export-excel`, params })
  }
}
